<?php
/**
 * Created by PhpStorm.
 * User: 76683
 * Date: 2018/7/21
 * Time: 0:15
 */

namespace app\sd\admin;


use app\admin\controller\Admin;
use app\common\builder\ZBuilder;
use app\sd\model\WeDayTopic;

class DayTopic extends Admin
{
    public function index(){
        $map = $this->getMap();
        $map['dt.is_delete']= 0;
        $data_list = WeDayTopic::topicList($map);
        $columns = [
            ['id', 'ID'],
            ['content', '话题'],
            ['photos', '话题配图', 'pictures'],
            ['nick_name', '用户昵称'],
            ['category_name', '领域'],
            ['likes', '点赞数'],
            ['create_time', '创建时间', 'datetime'],
            ['update_time', '更新时间', 'datetime'],
            ['right_button', '操作', 'btn']
        ];
        return ZBuilder::make('table')
            ->setRowList($data_list)
            ->addRightButtons(['delete'])
            ->addColumns($columns)
            ->setTableName('we_day_topic')
            ->fetch();
    }
}